package router

import (
	"service/app/api"

	"github.com/gin-gonic/gin"
)

func AdminRouteInit() {
	// 打散 分类挂载,在路由页面调用
	JoinRoutes(func(pubRoute, authRoute *gin.RouterGroup) {
		// 创建路由
		// 创建实例化Api
		//  api 需要能力 : 上下文解析,函数调用时默认传gin.context
		//				  解析上下文件需要 dto约束传值

		adminApi := api.CreateAdminApi()
		adminGroup := authRoute.Group("admin")

		adminGroup.POST("/rmnotuselist", adminApi.AdminRmnotUseLink)

		// 弃用api
		// adminGroup.GET("/roles/:username", adminApi.RolesByUsername)
		// adminGroup.GET("/allrole", adminApi.AllRole)
		// adminGroup.GET("/list", adminApi.AdminList)
		// adminGroup.POST("/addpolicy", adminApi.AddPolicy)
		// adminGroup.POST("/allocation", adminApi.AdminAlloctionGroup)
		// adminGroup.POST("/roles_allow/:username", adminApi.AdminAlloctionRoles)
		// adminGroup.POST("/addpolicylist", adminApi.AddPolicyList)
		// adminGroup.GET("/role/:perm", adminApi.SingleRole)
		// adminGroup.GET("/allpolicy", adminApi.AllPolicy)

	})
}
